package org.lw.consumer.feign;


import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(value = "${application.provider.name}",fallback = ProviderClientFallBack.class)  // 服务名称
public interface ProviderClient {
    @PostMapping("/provider/{username}")  //路径
     String findProvider(@PathVariable("username") String username);
    @GetMapping("/hello")
    String hello();
    @PutMapping("/provider/{productId}/{count}")
     String deduct(@PathVariable("productId") Long productId, @PathVariable("count") Integer count) throws DegradeException;
}
//当请求ProviderClient的test方法时，会调用NacosProvider服务的/provider路径，返回结果。
//发送的数据可以以参数的形式传递。